/*
 *
 * Copyright (C) 2012 Walter Lütgenau
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package offset.nodes.server.error.model;

import offset.nodes.client.model.Severity;
import java.util.Locale;
import java.util.ResourceBundle;

/**
 *
 * @author Walter Lütgenau
 */
public class ExceptionId {
    public static ExceptionId GENERAL_SYSTEM_EXCEPTION = new ExceptionId("general.system", Severity.Warning);
    public static ExceptionId GENERAL_PARAMETER_ERROR = new ExceptionId("general.parameterError", Severity.Error);
    public static ExceptionId GENERAL_PATH_INVALID = new ExceptionId("general.pathInvalid", Severity.Debug);
    public static ExceptionId GENERAL_LOGIN_FAILED = new ExceptionId("general.loginFailed", Severity.Warning);

    public static ExceptionId NODE_COPY_RECURSIVE = new ExceptionId("node.copyRecursive", Severity.Error);
    
    public static ExceptionId SAVE_AS_ALREADY_EXISTING = new ExceptionId("dialog.saveAs.alreadyExisting", Severity.Info);
    
    protected String id;
    protected Severity severity;

    public ExceptionId(String id, Severity severity) {
        this.id = id;
        this.severity = severity;
    }

    public String getId() {
        return id;
    }

    public Severity getSeverity() {
        return severity;
    }

    public ResourceBundle getBundle(Locale locale) {
        return ResourceBundle.getBundle("offset.nodes.server.error.view.ExceptionId", locale);
    }

}
